home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / ghostscript / ppath.ps < prev    next >
Text File  |  1994-08-01  |  2KB  |  51 lines

  1. %    Copyright (C) 1989, 1992, 1993 Aladdin Enterprises.  All rights reserved.
  2. %
  3. % This file is part of Ghostscript.
  4. %
  5. % Ghostscript is distributed in the hope that it will be useful, but
  6. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. % to anyone for the consequences of using it or for whether it serves any
  8. % particular purpose or works at all, unless he says so in writing.  Refer
  9. % to the Ghostscript General Public License for full details.
  10. %
  11. % Everyone is granted permission to copy, modify and redistribute
  12. % Ghostscript, but only under the conditions described in the Ghostscript
  13. % General Public License.  A copy of this license is supposed to have been
  14. % given to you along with Ghostscript so you can know your rights and
  15. % responsibilities.  It should be in a file named COPYING.  Among other
  16. % things, the copyright notice and this notice must be preserved on all
  17. % copies.
  18.  
  19. % Redefine pathforall for tracing.
  20. % Can't be used recursively.
  21.  
  22. /# {( )print} def
  23.  
  24. /-pathforall /pathforall load def
  25. /-p2 { ( ) print exch =only ( ) print =only } bind def
  26. /-tp2 { transform -p2 } bind def
  27. /-dict 5 dict def
  28.  
  29. /pathforall
  30.  { -dict begin
  31.    /-close exch def  /-curve exch def  /-line exch def  /-move exch def
  32.    end
  33.    {2 copy -p2 ( moveto\t%)print
  34.     2 copy -tp2 (\n)print
  35.     flush  -dict /-move get exec}
  36.    {2 copy -p2 ( lineto\t%)print
  37.     2 copy -tp2 (\n)print
  38.     flush  -dict /-line get exec}
  39.    {5 index 5 index -p2 3 index 3 index -p2 2 copy -p2 ( curveto\t%)print
  40.     5 index 5 index -tp2 3 index 3 index -tp2 2 copy -tp2 (\n)print
  41.     flush  -dict /-curve get exec}
  42.    {(closepath\n)print flush   -dict /-close get exec}
  43.    -pathforall
  44.   }
  45.  def
  46.  
  47. % Just print the current path
  48.  
  49. /printpath
  50.  { {pop pop} {pop pop} {pop pop pop pop pop pop} {} pathforall } def
  51.